<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$sqlarticle = "CREATE TABLE IF NOT EXISTS Article (
  articleID int(10) unsigned NOT NULL AUTO_INCREMENT,
  articlePUBLISH enum('true','false') DEFAULT NULL,
  articleTITLE varchar(150) DEFAULT NULL,
  articleSUBTITLE varchar(300) DEFAULT NULL,
  includeSUBTITLE enum('true','false') DEFAULT NULL,
  articleHEADER text,
  includeHEADER enum('true','false') DEFAULT NULL,
  articleFOOTER text,
  includeFOOTER enum('true','false') DEFAULT NULL,
  articleCONTENT text,
  includeCONTENT enum('true','false') DEFAULT NULL,
  articleAUTHOR int(11) DEFAULT NULL,
  articleCDATE date DEFAULT NULL,
  articleCTIME time DEFAULT NULL,
  articleMDATE date DEFAULT NULL,
  articleMTIME time DEFAULT NULL,
  PRIMARY KEY (articleID)
)";

$pdocreate->exec($sqlarticle);

$sqltag = "CREATE TABLE IF NOT EXISTS Tag (
  tagID int(11) NOT NULL AUTO_INCREMENT,
  tagNAME varchar(50) NOT NULL,
  tagHEADER text NOT NULL,
  tagFOOTER text NOT NULL,
  PRIMARY KEY (tagID)
)";

$pdocreate->exec($sqltag);


$sqltagmenu = "CREATE TABLE IF NOT EXISTS TagMenu (
  tmID int(11) NOT NULL AUTO_INCREMENT,
  tmTAGID int(11) NOT NULL,
  tmMENUID int(11) NOT NULL,
  tmINDEX int(11) NOT NULL,
  PRIMARY KEY (tmID)
  )";

$pdocreate->exec($sqltagmenu);

$sqlpluginmenu = "CREATE TABLE IF NOT EXISTS PluginMenu (
  pmID int(11) NOT NULL AUTO_INCREMENT,
  pmNAME varchar(30) NOT NULL,
  pmPLUGIN varchar(20) NOT NULL,
  PRIMARY KEY (pmID)
)";

$pdocreate->exec($sqlpluginmenu);

$sqlsites = "CREATE TABLE IF NOT EXISTS Site (
  siteID int(11) NOT NULL AUTO_INCREMENT,
  siteNAME varchar(25) NOT NULL,
  PRIMARY KEY (siteID))";

$pdocreate->exec($sqlsites);

$sqlsitemenu = "CREATE TABLE IF NOT EXISTS SiteMenu (
  menuID int(11) NOT NULL AUTO_INCREMENT,
  menuSITE int(11) NOT NULL,
  menuINDEX int(11) NOT NULL,
  menuNAME varchar(30) NOT NULL,
  menuPLUGTYPE int(11) NOT NULL,
  PRIMARY KEY (menuID))";
$pdocreate->exec($sqlsitemenu);

$sqlgeist = "CREATE TABLE IF NOT EXISTS Geist (
  geistID int(11) NOT NULL AUTO_INCREMENT,
  geistUSER varchar(255) NOT NULL,
  geistPASS varchar(255) NOT NULL,
  PRIMARY KEY (geistID))";
$pdocreate->exec($sqlgeist);

$sqlpluginbasemenu1 = "INSERT INTO Geist (geistID, geistUSER, geistPASS) VALUES
(1,'admin', 'admin')";
$pdocreate->exec($sqlpluginbasemenu1);

$sqlplugin = "CREATE TABLE IF NOT EXISTS Plugin (

  plugin varchar(20) NOT NULL,
  PRIMARY KEY (plugin)
)";
$pdocreate->exec($sqlplugin);

$sqlpluginbase = "INSERT INTO Plugin (plugin) VALUES ('BASE')";
$pdocreate->exec($sqlpluginbase);


$sqlpluginbasemenu1 = "INSERT INTO PluginMenu (pmID, pmNAME, pmPLUGIN) VALUES
(1,'BASE:BLOG', 'BASE'),
(2,'BASE:NETWORK', 'BASE')";
$pdocreate->exec($sqlpluginbasemenu1);
?>
